import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login/login'
import productList from '@/components/productList/productList'
import modifyPw from '@/components/modifyPw/modifyPw'
import account from '@/components/account/account'
import myinvest from '@/components/myinvest/myinvest'
import consultant from '@/components/consultant/consultant'
import productDetail from '@/components/productDetail/productDetail'
import investDetail from '@/components/investDetail/investDetail'
import map from '@/components/investDetail/map'
import report from '@/components/investDetail/report'
import baseInfo from '@/components/investDetail/baseInfo'

Vue.use(Router);

let VueRouter = new Router({
  mode:'history',
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/',
      name: 'productList',
      component: productList
    },
    {
      path: '/productList',
      name: 'productList',
      component: productList
    },
    {
      path: '/modify',
      name: 'modifyPw',
      component: modifyPw
    },
    {
      path: '/account',
      name: 'account',
      component: account
    },
    //我的投资列表
    {
      path: '/myinvest',
      name: 'myinvest',
      component: myinvest
    },
    //  咨询顾问
    {
      path: '/consultant',
      name: 'consultant',
      component: consultant
    },
    //  产品详情
    {
      path: '/productDetail/:id',
      name: 'productDetail',
      component: productDetail
    },
    //  投资详情
    {
      path: '/investDetail/:productId',
      name:'investDetail',
      component: investDetail,
      children: [
        {
          path: '',
          component: baseInfo
        },
        {
          path: 'map',
          name:'map',
          component: map
        },
        {
          path: 'report',
          name:'report',
          component: report
        },
        {
          path: 'baseInfo',
          name:'baseInfo',
          component: baseInfo
        }
      ]
    }
  ]
});
export default VueRouter
